Repository navigation
fix(desktop): invert window-drag regions so chrome stays clickable, add drag strips to uncovered screens - #5911
Conversation
📝 WalkthroughWalkthroughDesktop window-drag regions are relocated to dedicated spacer elements, workspace fallback states gain a shared drag-aware shell, editor keyboard handling changes for Alt-modified chords, and renderer development guidance is expanded. ChangesDesktop drag-region layout
Workspace state-screen shell
Editor behavior and renderer guidance
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/desktop/AGENTS.md`:
- Around line 5-8: Expand the desktop AGENTS.md guidance to document the agent’s
responsibilities, capabilities, and interaction patterns, while preserving the
existing window-drag rule for empty leaf elements. Include actionable
expectations for how agents handle desktop UI interactions and avoid weakening
the current Chromium carve-out warning.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx`:
- Around line 75-79: Move V2WorkspaceTitle outside the div with the drag class
in the TopBar layout. Keep it as a normal sibling, and add a separate empty flex
filler element with the drag class beside it so drag applies only to a dedicated
empty leaf while preserving the existing spacing and alignment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d051b7b6-4399-4cc6-8073-e907f041bdf0
📒 Files selected for processing (14)
apps/desktop/AGENTS.mdapps/desktop/src/renderer/components/Chat/ChatInterface/components/TiptapPromptEditor/TiptapPromptEditor.tsxapps/desktop/src/renderer/providers/AuthProvider/AuthProvider.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/components/PRActionHeader/PRActionHeader.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/StateScreenShell/StateScreenShell.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/StateScreenShell/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsxapps/desktop/src/renderer/routes/_authenticated/layout.tsxapps/desktop/src/renderer/routes/_authenticated/settings/layout.tsxapps/desktop/src/renderer/routes/create-organization/page.tsxpackages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx
| ## Window-drag regions: `drag` on empty leaves only | ||
|
|
||
| Never mark a container with interactive children as `drag` and carve the children out with `no-drag`: Chromium loses the carve-outs when they sit inside masked, scrollable, or CSS-zoomed wrappers (OverflowFadeContainer, ZoomStable), which silently deadens every control under the bar. Instead, put `drag` only on dedicated empty leaf elements — traffic-light spacers and flex fillers (see TopBar, DashboardSidebarHeader, packages/panes TabBar). The worst failure mode then is "empty area not draggable" instead of "chrome swallows clicks". | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Document agent responsibilities and capabilities.
This adds interaction guidance, but does not identify agent responsibilities or capabilities as required for desktop AGENTS.md. As per coding guidelines, apps/desktop/**/AGENTS.md must “Document agent responsibilities, capabilities, and interaction patterns in AGENTS.md”.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/desktop/AGENTS.md` around lines 5 - 8, Expand the desktop AGENTS.md
guidance to document the agent’s responsibilities, capabilities, and interaction
patterns, while preserving the existing window-drag rule for empty leaf
elements. Include actionable expectations for how agents handle desktop UI
interactions and avoid weakening the current Chromium carve-out warning.
Source: Coding guidelines
| <div className="drag flex h-full min-w-0 flex-1 items-center justify-start"> | ||
| {isV2WorkspaceRoute && v2WorkspaceId && ( | ||
| <V2WorkspaceTitle workspaceId={v2WorkspaceId} /> | ||
| )} | ||
| </div> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep the v2 title outside the drag region.
V2WorkspaceTitle is rendered inside the drag element, so this is not an empty leaf. Make the title a normal sibling and place a separate empty flex filler beside it.
Proposed fix
- <div className="drag flex h-full min-w-0 flex-1 items-center justify-start">
+ <div className="flex h-full min-w-0 flex-1 items-center justify-start">
{isV2WorkspaceRoute && v2WorkspaceId && (
<V2WorkspaceTitle workspaceId={v2WorkspaceId} />
)}
+ <div className="drag h-full min-w-0 flex-1" />
</div>As per coding guidelines, apply drag only to dedicated empty leaf elements.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <div className="drag flex h-full min-w-0 flex-1 items-center justify-start"> | |
| {isV2WorkspaceRoute && v2WorkspaceId && ( | |
| <V2WorkspaceTitle workspaceId={v2WorkspaceId} /> | |
| )} | |
| </div> | |
| <div className="flex h-full min-w-0 flex-1 items-center justify-start"> | |
| {isV2WorkspaceRoute && v2WorkspaceId && ( | |
| <V2WorkspaceTitle workspaceId={v2WorkspaceId} /> | |
| )} | |
| <div className="drag h-full min-w-0 flex-1" /> | |
| </div> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx`
around lines 75 - 79, Move V2WorkspaceTitle outside the div with the drag class
in the TopBar layout. Keep it as a normal sibling, and add a separate empty flex
filler element with the drag class beside it so drag applies only to a dedicated
empty leaf while preserving the existing spacing and alignment.
Source: Coding guidelines
Summary
Users could no longer click the topbar (pane tab bar) or right-sidebar chrome in v2 workspaces. Root cause: since #5824 the chrome bars are marked
drag(Electron window-drag region) withno-dragcarve-outs on interactive children — and Chromium loses those carve-outs when they sit inside masked/scrollable wrappers (OverflowFadeContainer) or CSS-zoomed wrappers (ZoomStable), turning the entire bar into a drag surface that swallows clicks.This PR inverts the scheme everywhere:
draglives only on dedicated empty leaf elements (traffic-light spacers, flex fillers), never on containers with interactive children. Worst-case failure flips from "all controls dead" to "an empty sliver isn't draggable".packages/panesTabBar: root no longer draggable; empty filler right of tabs carriesdrag. Also removed the zero-tab special-case branch so an empty bar renders identically to a populated one.drag+ carve-outs), geometry-preserving.StateScreenShell), auth-pending and offline screens, AuthProvider hydration splash, create-organization page.Test Plan
https://claude.ai/code/session_01FicLuUF7gtWzs1XGu9ePwM
Summary by cubic
Fixes dead clicks in the top bar and sidebar by moving Electron window-drag regions to empty, non-interactive elements. Also adds drag strips to state screens so the window stays draggable when the tab bar/top bar isn’t shown.
TopBar,DashboardSidebarHeader, settings header, andpackages/panesTabBar(removed zero-tab special case). Controls remain clickable even inside masked/scrollable or zoomed wrappers.PRActionHeader, plus top drag strips for v2 workspace state screens (not-found/creating/host-incompatible/missing-worktree/loading), auth-pending and offline screens, hydration splash, and create-organization.TiptapPromptEditor: keep Cmd/Ctrl+Arrow (and Shift variants) inside the editor for line navigation; let Alt-resolved chords (e.g., Cmd+Opt+←/→) bubble to app hotkeys.apps/desktop/AGENTS.md.Written for commit 17b9f2b. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
UI Improvements